package goals;

import world.Person;
import world.PhysicalObject;
import control.GUI.Output;

public class GoalFlee extends Goal {

	protected PhysicalObject target;

	public PhysicalObject getTarget() {
		return target;
	}

	public GoalFlee(Person self, PhysicalObject target) {
		super(self, 95);
		this.target = target;
	}

	@Override
	public boolean act(Output out) {
		moveAway(target);
		if (this.timeLeft > 0) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public String toString() {
		return "flee from " + target.getName();
	}

	@Override
	public int getReevaluationTimeSpan() {
		return 5;
	}

}
